# Contributor: Peter Bui <pnutzh4x0r@gmail.com>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py3-tz
pkgver=2024.1
pkgrel=1
pkgdesc="Python3 definitions of world timezone"
url="https://pythonhosted.org/pytz/"
arch="noarch"
license="MIT"
depends="python3"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
subpackages="$pkgname-pyc"
source="https://pypi.python.org/packages/source/p/pytz/pytz-$pkgver.tar.gz"
builddir="$srcdir/pytz-$pkgver"

replaces="py-tz" # Backwards compatibility
provides="py-tz=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	gpep517 build-wheel --wheel-dir .dist --output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	cd pytz/tests
	../../.testenv/bin/python3 test_tzinfo.py
}

package() {
	python3 -m installer -d "$pkgdir" .dist/*.whl
}

sha512sums="
cc1e4c9b34c62791cea277a0ce188d975e62135cb15bccfb49dc1a9366c7697ead9c67956846699f18b90db4c66e6c5fe1a91a524d01ae821c0eaa613550ea74  pytz-2024.1.tar.gz
"
